﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Timer
{
    public partial class SettingForm : Form
    {
        public SettingForm()
        {
            InitializeComponent();
        }

        private void CancelButton_Click(object sender, EventArgs e)
        {

        }

        private void SettingForm_Load(object sender, EventArgs e)
        {
            
            this.workTimeSpin.Value =Program.Timer.IntervalTime.WorkTime.Minutes;
            this.restTimeSpin.Value = Program.Timer.IntervalTime.RestTime.Minutes;
        }

        private void OKButton_Click(object sender, EventArgs e)
        {
            TomatoTime _timeSetImMS = new TomatoTime(TimeSpan.FromMinutes((double)workTimeSpin.Value), TimeSpan.FromMinutes((double)restTimeSpin.Value));
            Program.Timer.IntervalTime = _timeSetImMS;
            Program.Timer.Restart();
        }

       
    }
}
